package com.base.cn.platform.os.controller.web.classes.topic.report;

import com.base.cn.platform.os.common.WebBaseController;
import com.base.cn.platform.os.service.course.classes.topic.report.ClassesTopicReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Map;

@Controller
@RequestMapping("/web/classes/topic")
public class WebClassesTopicReportController extends WebBaseController {

    @Autowired
    private ClassesTopicReportService classesTopicReportService;

    /**
     * 保存班级话题举报
     *
     * @param params 班级话题举报
     * @return 保存结果
     */
    @RequestMapping("/saveTopicReport")
    @ResponseBody
    public Map<String, Object> saveTopicReport(HttpServletRequest request,
                                               @RequestBody Map<String, Object> params) {
        BigDecimal userId = webMobileLoginUtil.getLoginUserId(request);
        params.put("userId", userId);
        return classesTopicReportService.saveClassesTopicReport(params);
    }
}
